<!DOCTYPE html>
<html lang="en">
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link href="css/style.css" rel="stylesheet">
    </head>
    <body>
        <h1>聊天室</h1>
        <div id="content" name="name" style="overflow-y: scroll;width:400px;height:300px;border:solid 1px #000;"></div>
        <br>
        <div>
            <input type="text" id="msg" style="width:200px;">
            <button id="submit">提交</button>
        </div>
        <script>
        //js 原生语法
        document.querySelector('#submit').addEventListener('click',function(){
            console.log(msg.value)
            let message = msg.value
            ws.send(message)
            msg.value = ''
        })
    </script>
    </body>
</html>